/*
 __   _____  _     ___     _   _ _   _ ___ _____ 
 \ \ / / _ \| |   / _ \   | \ | | \ | |_ _| ____|
  \ V / | | | |  | | | |  |  \| |  \| || ||  _|  
   | || |_| | |__| |_| |  | |\  | |\  || || |___ 
   |_| \___/|_____\___/___|_| \_|_| \_|___|_____|
                     |_____|                     
  (C)2024 YOLO NNIE

Description:
    YOLO nnie detection : Yolo nnie project trace helpers

License: halokitor @ xidian university
*/


#ifndef TRACE_H
#define TRACE_H

#include <stdio.h>
#include <sys/time.h>

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */

#define DEBUG_DETECTION   0
#define DEBUG_DRAWRECT    1
#define DEBUG_RTSP        0
#define DEBUG_LOG         1
#define DEBUG_PERF        0      // Debug time spend
#define DEBUG_FFMPEG      1

/* message that is destined to the user */
#define MSG(args...) printf(args)

#define MSG_DEBUG(FLAG, args...)                                                                            \
            do  {                                                                                           \
                if (FLAG)                                                                                   \
                    printf(args);                                                                           \
            } while (0)

#define MSG_PRINTF(FLAG, fmt, ...)                                                                          \
            do  {                                                                                           \
                if (FLAG)                                                                                   \
                    fprintf(stdout, fmt, ##__VA_ARGS__); \
            } while (0)

void _meas_time_start(struct timeval *tm);
void _meas_time_stop(struct timeval start_time, const char *str);


#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */

#endif
/* --- EOF ------------------------------------------------------------------ */
